package org.baeta;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.baeta.client.CountryInfoClient;
import org.baeta.client.CountryInfoJSONClient;
import org.baeta.model.AbstractBean;
import org.baeta.model.JSON2ModelFactory;
import org.json.JSONObject;
import junit.framework.TestCase;

/**
 * Description
 *
 * @author <a href="mailto:rui.baeta@gmail.com">Rui Baeta</a>
 */
public class CountryInfoTestCase extends TestCase
{
    private static final Log LOG = LogFactory.getLog(CountryInfoTestCase.class);

    public void testCountryInfoClient() throws Exception
    {
        CountryInfoClient client = new CountryInfoJSONClient();
        JSONObject jsonObject = (JSONObject) client.getCountryInfo("PT");

        AbstractBean bean = JSON2ModelFactory.getInstance().createBean(jsonObject);
        LOG.debug(bean); 
    }
}
